all: clean library tagserver tagexplorer tageditor tag findfiles

library:
	@echo "Common Libraries ..."
	@make -C ./common fresh

tageditor: library
	@echo "Tag Editor ..."
	@make -C ./tageditor


tagexplorer: library tageditor
	@echo "Tag Explorer ..."
	@make -C ./tagexplorer
	

tagserver: library
	@echo "Tagger Server ..."
	@make -C ./tagserver fresh

tag: library
	@echo "Tagger Commandline Processor ..."
	@make -C tag fresh
findfiles: library
	@echo "Find Files ..."
	@export QTDIR=/usr/lib/qt4/
	@make -C ./findfiles
tags: clean
	@ctags -R

docs: report tags
	@doxygen config.doxygen

report:
	@texi2pdf report.tex report.pdf

backup:
	@echo "Starting the backup of the source folder ... " `pwd`
	@cd ..;  find tagger-1.0 | egrep '.svn' > exclude; tar zcvf /home/bindu/backups/tagger_`date +%y%m%d`_`date +%H%M`.tgz tagger-1.0 -X exclude; rm exclude
	@chmod 444 /home/bindu/backups/*
	@echo "Done ..."
	@ls -lh /home/bindu/backups/
	


clean: 
	@echo "Common Libraries"
	@make -C ./common clean
	@echo "Tagger Commandline Processor"
	@make -C ./tag clean
	@echo "Tagger Server"
	@make -C ./tagserver clean
	@echo "Virtual Explorer...."
	@make -C ./tagexplorer clean
	@echo "Tageditor........."
	@make -C ./tageditor clean
	@echo "Findfiles........."
	@make -C ./findfiles clean
	@rm -f *~
	@rm -f tags
	@rm -rf html latex
	@rm -f *.dvi *.aux *.log *.toc
	@rm -f *.pdf

install: all
	@echo "Installing ..."

rpm:
	cd ..;  find tagger-1.0 | egrep '.svn' > exclude; tar zcvf /usr/src/rpm/SOURCES/tagger_latest.tgz tagger-1.0 -X exclude; 
	sudo rpmbuild -ba tagger.spec
